<HTML>

<HEAD><TITLE>Log Parser sample COM Input Format</TITLE></HEAD>

<BODY BGCOLOR="#EFEFFF" LINK="#000000" VLINK="#606060" ALINK="#303030">

<FONT SIZE="5"><B>Processes COM Input Format sample</B></FONT><BR>

<P>
This sample COM input format implements an enumerator of processes that are currently running.
</P>

<P>
The following steps need to be performed in order to use this input format:

<OL>

<LI>Build the sample code. You will have to use different commands depending on your build environment, however, in most cases, you can use <TT>NMAKE</TT> just by typing: <BR/> 
	<TT>NMAKE</TT><BR/>
The build process will create a <I>ProcessesInputContext.dll</I> binary.
</LI>

<P><BR/></P>

<LI>Register the <I>ProcessesInputContext.dll</I> binary with the following command: <BR/> 
	<TT>regsvr32 ProcessesInputContext.dll</TT>
</LI>

<P><BR/></P>


<LI>To see the fields returned by this input format, execute the following Log Parser command: <BR/> 
	<TT>logparser -h -i:COM -iprogid:MSUtil.LogQuery.Sample.Processes</TT> <BR/>

<P><BR/></P>

<LI>Execute the following Log Parser query to retrieve information about the currently running processes: <BR/> 
	<TT>logparser "SELECT * FROM ." -i:COM -iprogid:MSUtil.LogQuery.Sample.Processes</TT> <BR/>
	The query will return:<BR/>
	<FONT SIZE="3">
		<PRE>
ImageName        PID ParentPID Threads
---------------- --- --------- -------
[System Process] 0   0         2
System           4   0         74
smss.exe         336 4         2
csrss.exe        392 336       13
winlogon.exe     424 336       24
services.exe     468 424       21
lsass.exe        480 424       33
svchost.exe      636 468       12
svchost.exe      688 468       20
svchost.exe      772 468       14   
		</PRE>
	</FONT>
</LI>

<P><BR/></P>

</OL>

</P>


</BODY>
</HTML>